package cn.tedu.jsd2209.csmall.product.controller;

import cn.tedu.jsd2209.csmall.product.ex.ServiceException;
import cn.tedu.jsd2209.csmall.product.pojo.dto.AlbumAddNewDTO;
import cn.tedu.jsd2209.csmall.product.service.IAlbumService;
import cn.tedu.jsd2209.csmall.product.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.sql.rowset.serial.SerialException;
import javax.validation.Valid;

@RestController
@RequestMapping(value = "/album")
@Api(tags = "03.相册模块")
@Validated
public class AlbumController {
    @Autowired
    private IAlbumService albumService;
    @ApiOperation(value = "01.添加相册")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParam
    @PostMapping("/add-new")
    public JsonResult addNew(@Validated  AlbumAddNewDTO albumAddNewDTO){
            albumService.addNew(albumAddNewDTO);
            return JsonResult.ok();
    }

}
